package com.mec.offload.service.impl;


import com.mec.offload.dao.MecMapper;
import com.mec.offload.model.MEC;
import com.mec.offload.service.MecService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MecServiceImpl implements MecService {
    @Autowired
    private MecMapper mecMapper;
    public List<MEC> getAllMec(){
        try {
            return mecMapper.getAllMec();
        }catch (Exception e){

            e.printStackTrace();
        }
        System.out.println("MecServiceImpl error");
        return null;
    }

    public int updateMec(Integer id)
    {
        try {
            return mecMapper.updateMec(id);
        }catch (Exception e){
            e.printStackTrace();
        }
        return 0;
    }
//    public int deleteNodeTerm(NodeTerm nodeTerm)
//    {
//        try {
//            return nodeTermMapper.deleteNodeTerm(nodeTerm);
//        }catch (Exception e){
//            e.printStackTrace();
//        }
//        return 0;
//    }
//    public NodeTerm findNodeTerm(Integer id)
//    {
//        try {
//            return nodeTermMapper.findNodeTerm(id);
//        }catch (Exception e){
//            e.printStackTrace();
//        }
//        return null;
//    }
    public int queryAllCount(){
        return mecMapper.queryAllCount();
    }
    public List<MEC> queryAllDataFromTable(int page, int limit){
        page=(page-1)*limit;
        return mecMapper.queryAllDataFromTable(page,limit);
    }
}


